package com.hnzq.cloud;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.hnzq.cloud.dto.PageRolesDto;
import com.hnzq.cloud.dto.RoleDto;
import com.hnzq.cloud.model.Result;
import com.hnzq.cloud.param.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(value = "fresh-user-assembly",contextId = "RoleAPI",path = "FreRole")
public interface RoleAPI {

    /**
     * 分页条件查询角色
     * @param findRolesParam
     * @return
     */
    @GetMapping("findRolesByCondition")
    public Result<PageRolesDto> findRolesByCondition(@RequestBody FindRolesParam findRolesParam);


    /**
     * 新增角色
     * @param addRoleParam
     * @return
     */
    @PostMapping("addRole")
    public Result<RoleDto> addRole(@RequestBody AddRoleParam addRoleParam) ;


    /**
     * 更新角色
     * @param updateRoleParam
     * @return
     */
    @PutMapping("updateRoleById")
    public Result<RoleDto> updateRoleById(@RequestBody UpdateRoleParam updateRoleParam) throws JsonProcessingException;


    /**
     * 删除角色
     * @param deleteRoleParam
     * @return
     */
    @DeleteMapping("deleteRoleById")
    public Result<Boolean> deleteRoleById(@RequestBody DeleteRoleParam deleteRoleParam) throws JsonProcessingException;


}
